Skip to content

Instantly share code, notes, and snippets.

View gabbyprecious's full-sized avatar
🎯
Focusing

Precious Ndubueze gabbyprecious

🎯
Focusing
View GitHub Profile
@gabbyprecious
gabbyprecious / project-ideas01.md
Last active April 20, 2020 13:16 — forked from MWins/project-ideas01.md
Back end Projects - list

Project Ideas

Ok. I'm going to list off some ideas for projects. You will have to determine if any particular idea is good enough to include in a portfolio. These aren't creative ideas. They likely already exist. Some are way too advanced while others are simplistic.

I will recommend to post any project you make to github and make a github project page for it. Explain in as much detail as possible how you made it, how it can be improved etc. Document it.

If you pick an advanced idea, setup a development roadmap and follow it. This will show some project management skills.

Another piece of advice for those who are design challenged. Use different front end frameworks and use different themes for those frameworks to provide appealing designs without looking like yet another bootstrap site.

@gabbyprecious
gabbyprecious / main.py
Created May 16, 2020 19:26
For FastAPI CRUD app
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
async def root():
return {"message": "Hello World"}
@gabbyprecious
gabbyprecious / alembic\env.py
Created May 16, 2020 21:36
alembic for fastapi
import os, sys
from dotenv import load_dotenv
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
load_dotenv(os.path.join(BASE_DIR, ".env"))
sys.path.append(BASE_DIR)
# add your model's MetaData object here
# for 'autogenerate' support
# from myapp import mymodel
# target_metadata = mymodel.Base.metadata
import model
target_metadata = model.Base.metadata
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String
Base = declarative_base()
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True, index=True)
first_name = Column(String(150))
last_name = Column(String(150))
from pydantic import BaseModel
class UserBase(BaseModel):
username: str
class UserCreate(UserBase):
first_name: str
last_name: str
email: str
password: str
import bcrypt
from fastapi import APIRouter
from fastapi_sqlalchemy import db
#the following line of code are to import the user in our model and schema
from model import User as ModelUser
from schema import UserCreate as SchemaUser
from schema import User as Users
router = APIRouter()
from fastapi import Depends, FastAPI, Header, HTTPException
#this line imports users.py from the routers folder
from routers import users
import os
from fastapi_sqlalchemy import DBSessionMiddleware #middleware helper
#Also it will be will be import load_dotenv to connect to our db
from dotenv import load_dotenv
import bcrypt
from fastapi import APIRouter
from fastapi_sqlalchemy import db
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime
from datetime import datetime
Base = declarative_base()
class User(Base):
"""
This table records the users of the site
"""