Git Product home page Git Product logo

inplace's Introduction

Hi ๐Ÿ‘‹

I'm Abdallah Ahmed (AKA xUser5000). I'm a senior CS Student, Competitive Programmer, and Software Engineer. I love to solve problems, build cool projects, and share my knowledge with my fellows.

  • I was a Software Engineering Intern at Microsoft Egypt in 2023.
  • I was a successful participant at Google Summer of Code 2021 @Joplin.
  • I competed in the Africa & Arab Collegiate Programming Championship (ACPC) 2021 & 2022.
  • I enjoy Chess, Football, and Anime (especially Hunter X Hunter).

xUser5000

inplace's People

Contributors

amrmousa1682 avatar ashrafx22 avatar hamdymohamed162002 avatar hamdymohamedd avatar mohamedelhefni avatar omarashrafdev avatar xuser5000 avatar

Watchers

 avatar

Forkers

ashrafx22

inplace's Issues

Verification emails take a long time during testing

Each time we want to create an account, we must wait until the verification email is sent. Then, we should click on the link to verify the account.

This is a very long and tedious process, especially during testing.

We can solve it using one of the following ways:

  • Add an environment variable named REQUIRE_EMAIL_VERIFICATION and act according to its value.
  • Setup a new container that runs mailhog as an SMTP testing server

Atomicity problem in account registration

Problem

in backend/authentication/router.js:

authRouter.post('/register', schemaValidator(registerSchema), async (req, res) => {
    if (await User.findOne({ where: { email: req.body.email } })) {
        throw new ForbiddenError("Email already in use");
    }

    const user = await User.create({
        ...req.body,
        password: await hash(req.body.password)
    });

    const verificationToken = await VerificationToken.create({
        content: generateVerificationToken(user.id)
    });

    await sendMail(verificationEmail(req.body.email, verificationToken));

    res.json(user);
});

If the email was not sent successfully, we'll have an obsolete user account in the database.

Possible Solutions

Transaction rollback

We can include the database query in a postgres transaction and simply rollback it if we fail to send the email.

Explicit delete query

We can explicitly issue a delete query if the email was not sent.

we need .env.example in backend

I am trying to run the project and backend server is giving me

 Server is running on port undefined

we need to specify the default port without depending on .env value or throw exception to user and don't start service

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.