Giter Club home page Giter Club logo

appstarter's Introduction

Python & NextJs App Starter

Empower yourself with a real backend and frontend app starter using Python and Next.js.

This is an app starter using a python FastAPI backend and a TypeScript based React frontend leveraging NextJS. It comes with user authentication, database migrations, and a component library.

Api

First run cp api/dist.env.local api/.env.local and fill in the necessary environment variables if they are not already set.

To successfully use the backend, you will need to have a PostgreSQL database running. You can use the docker-compose.yml file in the root directory to run a PostgreSQL database. To run the database, navigate to the root directory and run docker-compose up.

To initialise the virtual environment from the root directory, run python3 -m venv venv and then source venv/bin/activate. Then run `pip install -r requirements.txt

The FastAPI backend is in the api directory. It uses Alembic for database migrations. To run the migrations, navigate to the api directory and run alembic upgrade head.

To then run the backend, navigate to the api directory and run uvicorn app.main:app --reload.

To create a new migration, run alembic revision -m "migration message".

Client

First run cp client/dist.env.local client/.env.local and fill in the necessary environment variables if they are not already set.

Install the dependencies by running npm install in the client directory.

You will need to have the backend running to use the frontend, if you only want to develop components, you can run the storybook without the backend.

The NextJS client is in the client directory. To run the client, navigate to the client directory and run npm run dev.

It ships with Storybook for component development. To run Storybook, navigate to the client directory and run npm run storybook.

Also included is TailwindCSS for styling. The Components are based on Catalyst UI.

To generate the AUTH_SECRET use npx auth secret. This will generate a random string that can be used as the AUTH_SECRET in the .env file.

appstarter's People

Contributors

jasaka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.