Skip to content
/ fasmo Public template

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

License

Notifications You must be signed in to change notification settings

Shiyinq/fasmo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Development

Backend

1. Create a Virtual Environment (venv)

Create a virtual environment (venv) using conda with the following command:

conda create -n [venv-name] python=3.10

Activate the venv with the following command:

conda activate [venv-name]

2. Install requirements

Install the required dependencies with the following command:

pip install -r requirements/dev.txt

3. Create the .env File

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

cp .env.example .env

4. Run the backend

Run the server with the following command:

sh script/start-dev.sh

5. Open the API Documentation

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

http://localhost:8000/docs

Frontend

1. Go to frontend folder

Go to frontend folder and install dependencies:

cd frontend
npm install

2. Create the .env File

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

cp .env.example .env

3. Run the frontend

Run development server

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Formatting

To make the code cleaner and more structured

Backend:

sh scripts/lint-fromat.sh

Frontend:

npm run lint
npm run format

Deployment

Before you begin, ensure you have Docker installed.

1. Create environment files

For the backend:

cp .env.example .env

For the frontend:

cd frontend
cp .env.example .env
cd ..

Open each .env file you have created and update the values as needed.

2. Build and run the Docker containers

docker compose up --build -d

Wait a few minutes for the setup to complete. You can then access:

About

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

Topics

Resources

License

Stars

Watchers

Forks