server
The OpenAPI spec, server and official web frontend for Pill City
Video demo
Here is a video demo for some of its features such as circle management, emoji reactions and post formatting
demo720.mp4
Architecture
The project consists of an API server written in Python/Flask, and a web frontend written in JavaScript/React
The API server stores information in a MongoDB database, and it uses S3 to store images and other types of media
Software prerequisites
Python 3.9
andvirtualenv
- Node.js v16 and Yarn
- python-devkit
API development
Prerequisite
Run cp .example.env .env
and make dev-deps
Run API locally
up # python-devkit alias
You will see the web frontend at localhost:3000
The API will be running at localhost:5000
Run API unit tests
make test
Dump dummy data into server
Make sure you have the API running
make dev-dump
Use ID ika
and password 1234
to log in
Run API database schema migration
Make sure you have the API running
make dev-release
Web frontend development
Prerequisite
Run cp web/.example.env web/.env
and cd web && yarn install
Run web frontend locally
cd web && yarn start
Start API and web frontend on LAN (e.g. Android emulator or iOS device)
- Figure out your LAN IP. You can do this by running
cd web && yarn start
and inspect theOn Your Network
IP printed bycreate-react-app
- Stop
yarn start
- Update
.env
- Replace
localhost
inCDN_URL
,S3_ENDPOINT_URL
andSTS_ENDPOINT_URL
with your LAN IP
- Replace
- Update
web/.example.env
2. Replacelocalhost
inREACT_APP_API_ENDPOINT
with your LAN IP - Run
up
andcd web && yarn start
as usual
Security
Please send security findings to [email protected]
.