Giter Site home page Giter Site logo

huilensolis / memoir Goto Github PK

View Code? Open in Web Editor NEW
18.0 1.0 1.0 4.23 MB

Memoir is a web text editor that doesn't steal your data.

Home Page: https://memoir-oak.vercel.app

JavaScript 0.21% CSS 3.23% TypeScript 96.56%
bun docker drizzle-orm elysiajs journal journaling nextjs prosemirror tailwindcss text-editor

memoir's Introduction

profile view count

Frame 7

const HuilenSolis: TFullStackDev = {
  technologies: {
    frontend: ['Typescript', 'Javascript', 'React js', 'Next js', 'Tailwind CSS', 'Zustand', 'HTML', 'CSS'],
    backend: ['Rust', 'Node js', 'Bun js', 'Express js', 'Elysia js', 'JWT', 'SequelizeORM', 'DrizzleORM', 'PostgreSQL'],
    testing: {
      backend: ['Bun test'],
      frontend: [], // TODO: learn frontend testing
    },
    curious_on: ['Turborepo', 'Docker', 'Encrypting']
  },
  development_environment: ['Arch Linux', 'Hyprland', 'Wayland', 'Oh My Zsh', 'Wezterm', 'Nvim', 'Brave'],
  design_patterns: ['Clean Architecture', 'SOLID', 'Screaming Architecture'],
  languages: ['English', 'Spanish'], // <-- TODO: add "Latin"
  currently_building: ['Build Square', 'Memoir'],
  say_hi(){
    console.log('Hey, welcome to my profile README.md')
    console.log('If you want to contribute to any of my repos, feel free to open an issue and make a PR!')
  }
}

GitHub Streak Top Langs

memoir's People

Contributors

huilensolis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

williamgyamfik

memoir's Issues

feature(api): add banning system

after #50 is completed, we need to have a way to ban users from using the application if the admin decides to do so

  • add an endpoint in /user to ban users
  • check for the request authenticated user role
  • if the role is admin, ban the target user by deactivating their account with UserProvider.delete()
  • if not, reject the request

feature(app): fix turbo scripts

right now, you can't run turbo setup or turbo clean-up from the root directory, you need to move into /apps/api to make it work.

  • add turbo.json to apps/api/
  • add setup script
  • add clean up script
  • make dev depend on setup

feat(api): add "clean" script to package json

when we work locally using docker volumes for the Postgresql database, we often need to delete the volumes and containers, so we can start with a clean database the next time we run "bun run dev" or "turbo dev".

  • Add the "clean" script to the package.json on the API folder
  • When the command is executed, clean up the docker container and volume

feature(api): add roles

add role 'admin' and 'user'

  • create table roles
  • always create a role 'user' and a 'admin'
  • assign roles to the user

feature(api): add user account re-active when user signs in

we detect if a user account is active or inactive by saving a date on a column on the user table called end_date, if the value of end_date is null, it means the account is active, if not, it is a deleted or inactive account.

when a user decides to delete his account, we give him 30 days to sign in again, and if he does, his account will be restored.
for that, what we need to do is:

  • When the user signs in successfully, we check if the account is inactive
  • if the account was inactive, we re-active it again, by setting the user column end_date to null
  • if the account is active, we continue as usual.

refactor(api): migrate set up and clean up scripts into a ts file

the set-up script has two errors

  • the migration script never exists in the process after it finishes the migration
  • the set up script never awaits for the docker database container to turn on and open the database connection
    so, we end with a script that turns on the docker container, and tries to migrate, but encounters an error because the database is not ready for connections yet, and if you run turbo run migrate, it never exits the process.

the solution can be to create a setup.ts file, where we:

  • run docker compose up
  • await until the database connection is ready
  • generate the migration files for drizzle (running drizzle-kit generate:pg)
  • run the migration
  • exit the migration process after has been 5 seconds
  • exit the process

feature(api): add @elysiajs/cron to delete users after they have deleted their account for 30 days

Elysia docs: https://elysiajs.com/plugins/cron

  • Install @elysiajs/cron with bun add @elysiajs/cron
  • Create a plugin for handling users deleting
  • Set timer to 24hs, so we run the cron once each day
  • On the cron function, look for all users that contain end date area with a date and not null
  • Delete all users with end_date set to a date older than 30 days from new today
  • add that plugin to the server, adding app.use(plugin) on src/app.ts

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.