Skip to content

Shiyinq/fasmo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

120 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

FASMO

            ('-.      .-')   _   .-')                
           ( OO ).-. ( OO ).( '.( OO )_              
   ,------./ . --. /(_)---\_),--.   ,--.).-'),-----. 
('-| _.---'| \-.  \ /    _ | |   `.'   |( OO'  .-.  '
(OO|(_\  .-'-'  |  |\  :` `. |         |/   |  | |  |
/  |  '--.\| |_.'  | '..`''.)|  |'.'|  |\_) |  |\|  |
\_)|  .--' |  .-.  |.-._)   \|  |   |  |  \ |  | |  |
  \|  |_)  |  | |  |\       /|  |   |  |   `'  '-'  '
   `--'    `--' `--' `-----' `--'   `--'     `-----' 

FASMO - FastAPI SvelteKit MongoDB

The project structure for the backend is inspired by this repository.

The frontend of the project is built using SvelteKit, initialized with the command:
npm create svelte@latest fasmo

Table of Contents

Quick Start

If you have make installed, follow these steps:

1. Create and edit environment files

cp .env.example .env
cp frontend/.env.example frontend/.env

Update the values in both .env files as needed.

2. Install and Run

# Install all dependencies (Backend & Frontend)
make install

# Run both Backend and Frontend
make dev

# Run quality checks (Linting & Tests)
make check

Backend

1. Create the .env File

Create and update .env file based on .env.example:

cp .env.example .env

Update the values in the .env file as needed.

2. Setup Environment

Using Makefile:

make install-be

Alternatively, manual steps:

python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements/base.txt -r requirements/dev.txt

3. Run the backend

Run the server using Makefile:

make dev-be

Or manually:

sh scripts/start-dev.sh

4. Open the API Documentation

The API documentation can be opened in a browser at the following address:

http://localhost:8000/docs

Frontend

1. Create the .env File

Create and update .env file based on .env.example:

cp frontend/.env.example frontend/.env

Update the values in the .env file as needed.

2. Install dependencies

Using Makefile:

make install-fe

Or manually:

cd frontend
npm install

3. Run the frontend

Using Makefile:

make dev-fe

Or manually:

cd frontend
npm run dev

Quality Control

To ensure code quality and consistency.

Using Makefile:

# Run all checks
make check

# Run only backend checks
make check-be

# Run only frontend checks
make check-fe

Or manually:

Backend:

sh scripts/lint-format.sh
pytest

Frontend:

cd frontend
npm run check
npm run format
npm run lint

Docker Quick Start (Local)

If you have Docker installed and want to run the project locally using containers:

1. Create and edit environment files

cp .env.example .env
cp frontend/.env.example frontend/.env

Update the values in both .env files as needed.

2. Run with Makefile

# Start in development mode
make docker-dev

# Start in production mode
make docker-prod

3. Access the app

Deployment

For detailed production deployment instructions, including VPS setup and CI/CD, please refer to DEPLOYMENT.md.

About

πŸš€ My starter project for the FASMO Stack, utilizing FastAPI, Svelte, and MongoDB to build a modern web application.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors